<?php

namespace App\Models;

use App\Services\CommonService;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Testing\Fluent\Concerns\Has;

class MemberAlipayRiskCredit extends Model
{
     use HasFactory;
    protected $table = 'sp_member_alipay_risk_credit';
    protected $primaryKey = 'id';
    public $timestamps = false;
    //查询地区信息

    public static function query($uid)
    {
        $res=self::where('uid',$uid)->orderBy('id','desc')->select('rentOnlineRiskLevelOverall','rentOnlineRiskLevelMultiRent','rentOnlineRiskLevelFulfill','create_time')->get();
        $res=obToArray($res);
        foreach ($res as &$v){
            $v['create_time']=date('Y-m-d H:i',$v['create_time']);
        }
        return $res;
    }

    public  function insertMember($cert_no,$cert_name,$mobile,$uid,$rentOnlineRiskLevelOverall,$rentOnlineRiskLevelMultiRent,$rentOnlineRiskLevelFulfill,$result)
    {
        $data=['cert_no'=>$cert_no,'cert_name'=>$cert_name,'mobile'=>$mobile,'uid'=>$uid,
            'rentOnlineRiskLevelOverall'=>$rentOnlineRiskLevelOverall,
            'rentOnlineRiskLevelMultiRent'=>$rentOnlineRiskLevelMultiRent,
            'rentOnlineRiskLevelFulfill'=>$rentOnlineRiskLevelFulfill,'result'=>$result,'create_time'=>time()];
        return self::insert($data);
    }



}
